{	Problem: http://codeforces.ru/problemset/problem/81/B
 	Verdict: Accepted
}
uses SysUtils;
var 
    ls,i:longint;
    s:string;
    f:boolean;
begin
readln(s);
s:=trim(s);
ls:=length(s);
i:=0;
while i<ls-1 do begin
    inc(i);
    if (s[i]=' ') and (s[i+1]=' ') then begin
        delete(s,i,1);
        dec(i);
        ls:=length(s);
    end;
end;
i:=0;
f:=false;
ls:=length(s)-1;
while i<ls do begin
    inc(i);
    if (s[i]='.') and (i=1) then begin
        write('...');
      inc(i,2);
        f:=false;
    end else
    if s[i]='.' then begin
        if not f then write(' ');
        write('...');
        inc(i,2);
        f:=false;   
    end else
    if s[i] in ['0'..'9'] then begin
        write(s[i]);
        f:=false;
    end else
    if s[i]=',' then begin
        write(', ');
        f:=true;
    end else 
    if (s[i]=' ') and (s[i-1] in ['0'..'9']) and (s[i+1] in ['0'..'9']) then begin
        if not f then write(' ');
        f:=false;
    end else 
    if s[i]<>' ' then f:=false;
end;
if (s[ls+1]<>' ') and (s[ls+1]<>'.') then write(s[ls+1]);
end.